<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<ui:include src="include/head.xhtml" />
</h:head>
<h:body>
	<ui:include src="include/header.xhtml" />
	<div class="main">
		<table width="100%">
			<tr>
				<td width="15%" valign="top">
					<ui:include src="include/menu.xhtml" />
				</td>
				<td class="main" valign="top">
					<div class='panel-header'>
						Расписание группы #{scheduleBean.group.title}
					</div>
					<h:form>
					<p>Четная неделя: </p>
					<ui:include src="include/week.xhtml">
						<ui:param name="week" value="#{scheduleBean.evenWeek}"/>
					</ui:include>
					<p>Нечетная неделя: </p>
					<ui:include src="include/week.xhtml">
						<ui:param name="week" value="#{scheduleBean.oddWeek}"/>
					</ui:include>
					<br />
					<h:commandButton value='Сохранить' 
									 action='#{scheduleBean.save}' 
									 rendered='#{scheduleBean.editMode}'/>
					<h:commandButton value='Завершить' 
					                 action='#{scheduleBean.finishEdit}' 
					                 rendered='#{scheduleBean.editMode}' />
					<h:commandButton value='Изменить' 
									 action='#{scheduleBean.edit}' 
									 rendered="#{authBean.loggedInAsAdmin and !scheduleBean.editMode}" />
					</h:form>
					
					<h:panelGroup rendered="#{scheduleBean.editMode}">
						<br /><br />
						<div class='panel-header'>
							Учебный план для специальности "#{scheduleBean.group.speciality.title}" 
							на #{scheduleBean.group.term} семестр:
						</div>
						<br />
						<ui:repeat value="#{scheduleBean.plan}" var="pi">
							<div>
								#{pi.subject.title} - #{pi.hours} часов
							</div>
						</ui:repeat>
					</h:panelGroup>
					
					<h:messages />
				</td>
			</tr>
		</table>
	</div>
</h:body>
</html>